<%-- 
    Document   : viewQuestions
    Created on : 01/09/2011, 11:28:52 AM
    Author     : s4200768
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="../header.jsp" %>
<link rel="stylesheet" type="text/css" href="../style.css"/>
<div id="content-container">
    <div id="content">
        <!-- Content goes here -->
        <style type="text/css">
            #qu{
                padding-left:21.5px;
            }
            #tb{
                margin-top:10px;
                margin-left:10px;
            }
            #data{
                float:left;
                margin-top:0px;
                padding-top:5px;
                padding-left: 80px;
                padding-right: 30px;
                padding-bottom: 30px;
            }
            
           .creatortable {
            font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
            width:80%;
            border:1px solid #009933;
            text-align:center;
            }
            .creatortable td, .creatortable th .creatortable tr {
            font-size:1em;    
            border:1px solid #009933;
            padding:3px 7px 2px 17px;
            }
            .creatortable th {
            font-size:1.1em;
            text-align:center;
            padding-top:5px;
            padding-bottom:4px;
            background-color:#008833;
            color:#ffffff;
            }
        </style>
        <h3>Question Details</h3>
        <div id="data">
            <form:form method="post" commandName="viewAnswers" name="Answer" id="Answer">
                <div id="qu"><b>Question: </b><c:out value="${question}"></c:out></div>
                    <div id="tb">
                        <table class="creatortable" id="tb">
                        <c:choose>
                            <c:when test = "${type == 0}">
                                <tr><th>Answer ID</th><th>Answer Text</th><th>Weighting</th></tr>
                                <c:forEach items="${answers}" var="answer">     
                                    <tr>
                                        <!-- need to change this to question related stuff after finding out from tom what that is-->
                                        <td>${answer.getId()}</td>
                                        <td>${answer.getText()}</td>
                                        <td>${answer.getWeighting()}</td>
                                    </tr>
                                </c:forEach>
                            </c:when>
                            <c:otherwise>
                                <tr><th>Answer ID</th><th>Answer Text</th></tr>
                                <c:forEach items="${answers}" var="answer">     
                                    <tr>
                                        <!--                            need to change this to question related stuff after finding out from tom what that is-->
                                        <td>${answer.getId()}</td>
                                        <td>${answer.getText()}</td>
                                    </tr>
                                </c:forEach>
                            </c:otherwise>
                        </c:choose>
                        <c:out value="${fail}"/>

                    </table>
                </div>
            </form:form>
            <ul>
                <li>
                    <a href="addAnswer.html?qid=<c:out value="${qids}"/>&type=<c:out value="${type}"/>">Add Answer</a>
                </li>
            </ul>

            <p> <input type="button" value="Back" onClick="javascript: history.go(-1)"></p>

        </div>
        <div id="data2">

        </div>
    </div>
</div>		

<%@ include file="../footer.jsp" %>

